package com.xialinrui.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xialinrui.entity.NoteCategory;
import com.xialinrui.mapper.NoteCategoryMapper;
import com.xialinrui.service.NoteCategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xialinrui
 */
@Service
public class NoteCategoryServiceImpl extends ServiceImpl<NoteCategoryMapper, NoteCategory> implements NoteCategoryService {

    @Resource
    private NoteCategoryMapper noteCategoryMapper;

    @Override
    public void addCategory(String name) {
        noteCategoryMapper.insert(new NoteCategory(null, name));
    }

    @Override
    public void delete(List<Long> ids) {
        noteCategoryMapper.deleteBatchIds(ids);
    }
}
